﻿using FastEndpoints;

namespace vite_net.Controllers.WorkFlow
{
    public class MyEndpoint : Endpoint<CreateFlowRequest, MyResponse>
    {
        public override void Configure()
        {
            Post("/api/user/create");
            AllowAnonymous();
        }

        public override async Task HandleAsync(CreateFlowRequest req, CancellationToken ct)
        {
            await SendAsync(new()
            {
                FullName = req.FirstName + " " + req.LastName,
                IsOver18 = req.Age > 18
            });
        }
    }

}
